<?php /* Smarty version Smarty-3.1.13, created on 2013-07-09 04:39:23
         compiled from ".\templates\displayLoan.tpl" */ ?>
<?php /*%%SmartyHeaderCode:1116851db4c20db90d0-80691776%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'a80f71fbe750b4db66f4f210c76f2e69ae65d50d' => 
    array (
      0 => '.\\templates\\displayLoan.tpl',
      1 => 1373344752,
      2 => 'file',
    ),
    '76b183ae9ab092866ef1aa82b739ad39fdc5fb7c' => 
    array (
      0 => 'D:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\fin3\\templates\\link.tpl',
      1 => 1373336611,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '1116851db4c20db90d0-80691776',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.13',
  'unifunc' => 'content_51db4c20ecd212_44393758',
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_51db4c20ecd212_44393758')) {function content_51db4c20ecd212_44393758($_smarty_tpl) {?><?php if (!is_callable('smarty_function_html_select_date')) include 'D:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\fin3\\include\\Smarty\\libs\\plugins\\function.html_select_date.php';
?><html>
	<head>
	  <link rel="stylesheet" href="css/style1.css">
	  <link rel="stylesheet" type="text/css" href="./css/main.css" />
    <link rel="stylesheet" type="text/css" href="./css/style.css" />
	</head>
	
<script src="js/jquery.min.js" ></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="media/js/jquery.js" type="text/javascript"></script>
<script src="media/js/jquery.dataTables.js" type="text/javascript"></script>
<style type="text/css">
  @import "media/css/demo_table_jui.css";
  @import "media/themes/smoothness/jquery-ui-1.8.4.custom.css";
input[type="submit"], input[type="reset"] {
    -moz-border-radius: 10px;
    -webkit-border-radius: 10px;  
    border-radius: 10px;
    }

    input[type="button"] {
    float: right;
      margin: 2em 1em 0 1em;
      width: 5em;
      padding: .5em;
      border: 1px solid #666;
      -moz-border-radius: 10px;
      -webkit-border-radius: 10px;  
      border-radius: 10px;
      -moz-box-shadow: 0 0 .5em rgba(0, 0, 0, .8);
      -webkit-box-shadow: 0 0 .5em rgba(0, 0, 0, .8);
      box-shadow: 0 0 .5em rgba(0, 0, 0, .8);
      color: #fff;
      background: #0a0;
      font-size: 1em;
      line-height: 1em;
      font-weight: bold;
      opacity: .7;
      -webkit-appearance: none;
      -moz-transition: opacity .5s;
      -webkit-transition: opacity .5s;
      -o-transition: opacity .5s;
      transition: opacity .5s;
    }
    
    input[type="submit"]:hover,
    input[type="submit"]:active,
    input[type="reset"]:hover,
    input[type="reset"]:active {
      cursor: pointer;
      opacity: 1;
    }
    
    input[type="submit"]:active, input[type="button"]:active {
      color: #333;
      background: #eee;
      -moz-box-shadow: 0 0 .5em rgba(0, 0, 0, .8) inset;
      -webkit-box-shadow: 0 0 .5em rgba(0, 0, 0, .8) inset;
      box-shadow: 0 0 .5em rgba(0, 0, 0, .8) inset;
    }
    
    input[type="reset"] {
      background: #f33;
    }	
</style>
<style>
  *{
     font-family: arial;
   }
   
</style>
<script type="text/javascript" charset="utf-8">
  $(document).ready(function(){
    $('#datatables').dataTable({
      "sPaginationType":"full_numbers",
      "aaSorting":[[2, "desc"]],
      "bJQueryUI":true
    });
  });
  function selectLoans()
  {
  	
  	  var startDay=document.frm.StartDateDay.value;
      var startMonth=document.frm.StartDateMonth.value;
      var startYear=document.frm.StartDateYear.value;
      
      var startDate=startYear+'-'+startMonth+'-'+startDay;

      var endDay=document.frm.EndDateDay.value;
      var endMonth=document.frm.EndDateMonth.value;
      var endYear=document.frm.EndDateYear.value;
      
      var endDate=endYear+'-'+endMonth+'-'+endDay;
      
      
  	loanStatus = $("#loanStatus").val();
    $.ajax({
      url:'selectLoansAjax.php',
      dataType:'HTML',
      data: 'loanStatus='+loanStatus+'&startDatePass='+startDate+'&endDatePass='+endDate,
      type:'GET',
      success:function(msg)
      {
        $('#displayDiv').html(msg);
         $('#datatables').dataTable({
           "sPaginationType":"full_numbers",
           "aaSorting":[[2, "desc"]],
           "bJQueryUI":true
         });
      }
    });
  }
</script>

	<body>
  	<ul class="menu">
	    <li><a href="#">Home</a></li>
	    <li><a href="index.php">Party Entry</a></li>
	    <li><a href="loan.php">Loan Entry</a></li>
	    <li><a href="loandetail.php">Loan Detail</a></li>
	    <li><a href="account.php">Account</a></li>
	    <li><a href="transaction.php">Transaction</a></li>
	    <li><a href="#">Display</a>
	      <ul>
	        <li><a href="displayClient.php">Parties</a></li>
	        <li><a href="displayLoan.php">Loans</a></li>
	        <li><a href="dispalyTransaction.php">Transactions</a></li>
	        <li><a href="loanreceived.php">LoanReceived</a></li>
	      </ul>
	    </li>
    </ul>
    
<br /><br /><br /><br /><br /><br /><br />
<form name="frm" id="frm" method="post">
<table align="center">
  <tr>
    <td>
      <select name="loanStatus" id="loanStatus" onchange="selectLoans(this);">
        <option value="current">Current</option>
        <option value="old">Old</option>
        <option value="all">All</option>
      </select>
       To:
      <?php echo smarty_function_html_select_date(array('prefix'=>'StartDate','id'=>"StartDate",'time'=>$_smarty_tpl->tpl_vars['today']->value,'start_year'=>'-5','end_year'=>'+5','field_order'=>"DMY",'month_format'=>"%m"),$_smarty_tpl);?>

       From:
      <?php echo smarty_function_html_select_date(array('prefix'=>'EndDate','time'=>$_smarty_tpl->tpl_vars['today']->value,'start_year'=>'-5','end_year'=>'+5','field_order'=>"DMY",'month_format'=>"%m"),$_smarty_tpl);?>

    </td>
    <td>
      <input type="button" name="go" id="go" value="Go" onclick="selectLoans()"> 
    </td>
  </tr>
</table>
</form>
<div id="displayDiv">
  <table id="datatables" class="display">
    <thead>
      <tr>
        <th>Delete</th>
        <th>partyName</th>
        <th>loanDate</th>
        <th>loanAmount</th>
        <th>interest</th>
        <th>installmentAmount</th>
        <th>installmentDays</th>
      </tr>
    </thead>
    <tbody id="insData">
      <?php if (isset($_smarty_tpl->tpl_vars['smarty']->value['section']['rec'])) unset($_smarty_tpl->tpl_vars['smarty']->value['section']['rec']);
$_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['name'] = 'rec';
$_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['loop'] = is_array($_loop=$_smarty_tpl->tpl_vars['loans']->value) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['show'] = true;
$_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['max'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['loop'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['step'] = 1;
$_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['start'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['step'] > 0 ? 0 : $_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['loop']-1;
if ($_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['show']) {
    $_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['total'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['loop'];
    if ($_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['total'] == 0)
        $_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['show'] = false;
} else
    $_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['total'] = 0;
if ($_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['show']):

            for ($_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['index'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['start'], $_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['iteration'] = 1;
                 $_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['iteration'] <= $_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['total'];
                 $_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['index'] += $_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['step'], $_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['iteration']++):
$_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['rownum'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['iteration'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['index_prev'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['index'] - $_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['step'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['index_next'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['index'] + $_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['step'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['first']      = ($_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['iteration'] == 1);
$_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['last']       = ($_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['iteration'] == $_smarty_tpl->tpl_vars['smarty']->value['section']['rec']['total']);
?> 
        <tr>
          <td><?php echo $_smarty_tpl->tpl_vars['loans']->value[$_smarty_tpl->getVariable('smarty')->value['section']['rec']['index']]['Delete'];?>
</td>
          <td><?php echo $_smarty_tpl->tpl_vars['loans']->value[$_smarty_tpl->getVariable('smarty')->value['section']['rec']['index']]['partyName'];?>
</td>
          <td align="center"><?php echo $_smarty_tpl->tpl_vars['loans']->value[$_smarty_tpl->getVariable('smarty')->value['section']['rec']['index']]['loanDate'];?>
</td>
          <td align="right"><?php echo $_smarty_tpl->tpl_vars['loans']->value[$_smarty_tpl->getVariable('smarty')->value['section']['rec']['index']]['loanAmount'];?>
</td>
          <td align="right"><?php echo $_smarty_tpl->tpl_vars['loans']->value[$_smarty_tpl->getVariable('smarty')->value['section']['rec']['index']]['interest'];?>
</td>
          <td align="right"><?php echo $_smarty_tpl->tpl_vars['loans']->value[$_smarty_tpl->getVariable('smarty')->value['section']['rec']['index']]['installmentAmount'];?>
</td>
          <td align="right"><?php echo $_smarty_tpl->tpl_vars['loans']->value[$_smarty_tpl->getVariable('smarty')->value['section']['rec']['index']]['installmentDays'];?>
</td>
        </tr>
      <?php endfor; endif; ?>
    </tbody>
  </table>
</div>

	</body>
</html><?php }} ?>